<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Decrypts crypttext with given parameters</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mcrypt-create-iv.html">mcrypt_create_iv</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-ecb.html">mcrypt_ecb</a></div>
 <div class="up"><a href="ref.mcrypt.html">Mcrypt 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mcrypt-decrypt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mcrypt_decrypt</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5)</p><p class="refpurpose"><span class="refname">mcrypt_decrypt</span> &mdash; <span class="dc-title">Decrypts crypttext with given parameters</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mcrypt-decrypt-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>mcrypt_decrypt</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cipher</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$mode</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$iv</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Decrypts the <em><code class="parameter">data</code></em> and returns the unencrypted data.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.mcrypt-decrypt-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">cipher</code></em></dt>

     <dd>

      <p class="para"><strong><code>MCRYPT_ciphername</code></strong> 常量中的一个，或者是字符串值的算法名称。</p>
     </dd>

    
    
     <dt>
<em><code class="parameter">key</code></em></dt>

     <dd>

      <p class="para">
       The key with which the data was encrypted. If it&#039;s smaller
       than the required keysize, it is padded with
       &#039;<em>\0</em>&#039;.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">data</code></em></dt>

     <dd>

      <p class="para">
       The data that will be decrypted with the given <em><code class="parameter">cipher</code></em>
       and <em><code class="parameter">mode</code></em>. If the size of the data is not n * blocksize,
       the data will be padded with &#039;<em>\0</em>&#039;.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">mode</code></em></dt>

     <dd>

      <p class="para"><strong><code>MCRYPT_MODE_modename</code></strong> 常量中的一个，或以下字符串中的一个：&quot;ecb&quot;，&quot;cbc&quot;，&quot;cfb&quot;，&quot;ofb&quot;，&quot;nofb&quot; 和 &quot;stream&quot;。</p>
     </dd>

    
    
     <dt>
<em><code class="parameter">iv</code></em></dt>

     <dd>

      <p class="para">在 CBC, CFB, OFB 模式中用于初始化过程，在 STREAM 模式中用于某些算法。如果未提供 IV 并且在某算法中需要，本函数发出一条警告并使用一个全部字节设为 &quot;<em>\0</em>&quot; 的 IV。</p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.mcrypt-decrypt-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the decrypted data as a string.
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mcrypt-create-iv.html">mcrypt_create_iv</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mcrypt-ecb.html">mcrypt_ecb</a></div>
 <div class="up"><a href="ref.mcrypt.html">Mcrypt 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
